<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="/include/head.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>分配权限</title>
<script type="text/javascript">
(function($){
	$(".dialogContent").css({
			'overflow-y': 'auto'
		});
})(jQuery);

function getCheckValues(){
	var results='';
	$(".checked").each(function(){
		results += $(this).children().val()+",";
	});
	$("#ids").val(results);
}
</script>
</head>
<body>

<div class="panelBar">
	<ul class="toolBar">
		<!-- 
			<li class="line">line</li>
			<li><a class="add" href="payment/toEditPaymentRcd.do?tOf=-1&funId=${funId}" target="navTab" rel="payemntRcdDetail"><span>添加支出记录</span></a></li> 
		-->	
	</ul>
</div>
	<div class="pageContent">
		<form class="pageForm required-validate" onsubmit="getCheckValues();return validateCallback(this, navTabAjaxDone);" action="sys/role/editRoleFunction.do?funId=${funId}" method="post" novalidate="novalidate">
			<div class="pageContent"  layoutH="62">
				<input type="hidden" name="id" value="${object.id }" />
				<input type="hidden" id="ids" name="ids" value="" />
				
				<ul class="tree treeFolder treeCheck expand">
				    <c:forEach items="${allMenus}" var="item">
				        <li><a >${item.title }</a>
							<ul>
							    <c:forEach items="${item.functionList}" var="fun">
							        <c:choose >
							            <c:when test="${fun.enable==1 }">
							            	<li><a tname="functionIds" tvalue="${fun.id }" checked="true"><span style="color:blue">${fun.title }</span></a></li>
							            </c:when>
							            <c:otherwise>
							            	<li><a tname="functionIds" tvalue="${fun.id }">${fun.title }</a></li>
							            </c:otherwise>
							        </c:choose>
							    </c:forEach>
							</ul>
						</li>
				    </c:forEach>
				</ul>
	
			</div>
			<div class="formBar">
				<ul>
					<li>角色名：<input id="roleName" type="text" size="30" name="roleName" value="${object.roleName}" ></input></li>
					<li>备注：<input id="description" type="text" size="30" name="description" value="${object.description}" ></input></li>
					<li><div class="buttonActive"><div class="buttonContent"><button type="submit">保存</button></div></div></li>
					<li><div class="button"><div class="buttonContent"><button class="close" type="button">取消</button></div></div></li>
				</ul>
			</div>
		</div>
		</form>
	</div>

</body>
</html>